<extend name="Index::index"/>
<block name="title"><title>广告管理</title></block>
<block name="table">
	<div class="agoods_nav">
		<span>广告列表</span>
		<a href="{:U('Adver/add')}"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">添加广告</button></a>
	</div>
	<table class="table" border="1" cellpadding="5" cellspacing="0" >
		<tr bgcolor="#ccc" height="50">
			<th>编号</th>
			<th>位置</th>
			<th>图片</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
		<notempty name="list">				
		<foreach name="list" item="value">
			<tr>
				<td>{$value['id']}</td>
				<td>
					<switch name="value.location">
					<case value="1">广告一</case>
					<case value="2">广告二</case>
					<case value="3">广告三</case>
					</switch>
				</td>
				<td><img src="__ROOT__{$value['name']}" alt="美工回家生娃了"></td>
				<td width="100"><if condition="$value['status'] eq 1">
					<button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">显示</button>
					<else/>
					<a href="{:U('Adver/check',['id'=>$value['id'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">不显示</button></a>
					</if>
				</td>
				<td>
					<a href="{:U('Adver/del',['id'=>$value['id']])}"><span style="color:#000;">删除</span></a>
				</td>
			</tr>
		</foreach>
		<else/>
		<tr>
			<th colspan="5">还木有广告</th>
		</tr>
		</notempty>
		<tr>
			<th colspan="5" height="50px">
				{$page}
			</th>
		</tr>
	</table>
</block>